package com.sangu.dianxiu.adapter;

import android.content.Context;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;

import com.sangu.dianxiu.R;
import com.sangu.dianxiu.bean.repairtype.RepairProjectListEntity;

import java.util.List;

/**
 * 维修项目列表adapter ，继承自AppBaseAdapter
 * Created by sg2 on 2015/12/31.
 */
public class RepairProjectListLiewAdapter extends AppBaseAdapter<RepairProjectListEntity.ItemsEntity>{
    public RepairProjectListLiewAdapter(List list, Context context) {
        super(list, context);
    }

    @Override
    public ViewHolder getViewHolder(int position, View convertView, ViewGroup parent) {

        RepairProjectListEntity.ItemsEntity entity=list.get(position);
        ViewHolder vh=ViewHolder.get(context,convertView,parent, R.layout.item_repair_project_list);
        TextView tvName= (TextView) vh.findViewById(R.id.tv_item_repair_project_name);
        TextView tvPrice= (TextView) vh.findViewById(R.id.tv_item_repair_project_price);
        tvName.setText(entity.getItemName());
        tvPrice.setText(entity.getPrice()+"");
       return vh;           //此为返回的listview的每项的视图
    }
}
